<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>feval</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : 20/12/2004</div>
    <p>
      <b>feval</b> -  multiple evaluation</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>[z]=feval(x,y,f)  </tt>
      </dd>
      <dd>
        <tt>[z]=feval(x,f)  </tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>x,y</b>
        </tt>: two vectors</li>
      <li>
        <tt>
          <b>f</b>
        </tt>: function or character string (for Fortran or C call)</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
    Multiple evaluation of a function for one or two arguments 
    of vector type :
  </p>
    <dl>
      <dd>
        <b>z=feval(x,f)</b>returns the vector <tt>
          <b>z</b>
        </tt> defined by <tt>
          <b>z(i)=f(x(i))</b>
        </tt>
      </dd>
      <dd>
        <b>z=feval(x,y,f)</b>returns the matrix <tt>
          <b>z</b>
        </tt> such as <tt>
          <b>z(i,j)=f(x(i),y(j))</b>
        </tt>
      </dd>
    </dl>
    <p>
      <tt>
        <b>f</b>
      </tt> is an external (function or routine) accepting
    on one or two  arguments which are supposed to be real.
    The result returned by <tt>
        <b>f</b>
      </tt> can be real or complex. 
    In case of a Fortran call, the function <tt>
        <b> 'f' </b>
      </tt> must be defined 
    in the subroutine <tt>
        <b>ffeval.f</b>
      </tt> (in directory <tt>
        <b>SCIDIR/routines/default</b>
      </tt>)</p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

deff('[z]=f(x,y)','z=x^2+y^2');
feval(1:10,1:5,f)
deff('[z]=f(x,y)','z=x+%i*y');
feval(1:10,1:5,f)
feval(1:10,1:5,'parab')   //See ffeval.f file
feval(1:10,'parab')
// For dynamic link (see example ftest in ffeval.f)
// you can use the link command (the parameters depend on the machine):
// unix('make ftest.o');link('ftest.o','ftest); feval(1:10,1:5,'ftest') 
 
  </pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="evstr.htm">
        <tt>
          <b>evstr</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../polynomials/horner.htm">
        <tt>
          <b>horner</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="execstr.htm">
        <tt>
          <b>execstr</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="external.htm">
        <tt>
          <b>external</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../utilities/link.htm">
        <tt>
          <b>link</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
  </body>
</html>
